#include <iostream>
#include "Client.h"

int main(int argc, char* arcv[])
{
    const char* rtspUrl;
    int flvPort;
    std::string flvUrl;
    if(argc <= 3)
    {
        rtspUrl = "rtsp://admin:jiankong123@192.168.23.19:554/cam/realmonitor?channel=1&subtype=0";//测试摄像头
        std::cout << "未设置摄像头流地址，采用默认流地址：" << rtspUrl << std::endl;
        flvPort = 81;
        flvUrl = "/test.flv";
    }
    else
    {
        rtspUrl = arcv[1];
        flvPort = atoi(arcv[2]);
        flvUrl = arcv[3];
    }

    while (true)
    {
        bool noError = true;
        Client client(rtspUrl, flvPort, flvUrl, noError);
        if(!noError) break;
    }
    
    return 0;
}